package com.jackiechan.dao.Impl;

import com.jackiechan.dao.StudentsDao;
import com.jackiechan.domain.Students;
import com.jackiechan.util.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class StudentsDaoImpl implements StudentsDao {
    @Override
    public List<Students> selectStudents() {
        // 获取SqlSession对象
        SqlSession sqlSession = MyBatisUtils.getSqlSession();
        String sqlId = "com.jackiechan.dao.StudentsDao"+"."+"selectStudents";
        List<Students> students = sqlSession.selectList(sqlId);
        sqlSession.close();
        return students;
    }

    @Override
    public int insertStudent(Students students) {
        return 0;
    }
}
